package com.briup.service.Impl;

import com.briup.bean.User;
import com.briup.dao.IUserDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class IUserService implements com.briup.service.IUserService {
    @Autowired
    private IUserDao userDao;

    @Override
    public User login(String name, String password) throws Exception {
        return userDao.userLogin(name,password);
    }

    @Override
    public void register(User user) throws Exception {
        userDao.saveUser(user);
    }

    @Override
    public User findByLoginName(String loginName) {
        return userDao.findByLoginName(loginName);
    }

    @Override
    public User findByEmail(String email) {
        return userDao.findByEmail(email);
    }

    @Override
    public User findByPhone(String phone) {
        return userDao.findByPhone(phone);
    }
}
